import 'package:thinking/entity/_.dart';
import 'package:thinking/config/_.dart';
import 'package:dio/dio.dart';
import 'package:thinking/http/Dio.dart';
class PublicService{

  static Future<List<ToolUpLoadFileData>> upLoadFile({required FormData params})async{
          var res =  await HttpApi().post(url: Config.apiUrl['ApiList']['upLoadFile'],options:Options(extra:{'showLoading':true}),params: params );
          return ToolUpLoadFileEntity.fromJson(res).data!;
  }

  /// App更新接口
  static Future<UpdateAppEntity> updateApp({ required Map<String, dynamic> params }) async {
    var res = await HttpApi().get(
        url: Config.apiUrl['ApiList']['updateApp'],
        params: params,
        options:Options(extra:{'showLoading':true})
    );
    return UpdateAppEntity.fromJson(res['data']);
  }

  /// 下载图片
  static Future downImage({required String url, required Map<String, dynamic> params}) async {
    print(url);
    return await HttpApi().get(
         url: url,
        params: params,
        options: Options(responseType: ResponseType.bytes,extra:{'showLoading':true,'isDownLoad':true}),
    );
  }

}